package com.yulang.common.pojo.goods;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * <p>
 * 品牌表
 * </p>
 *
 * @author Administrator
 * @since 2019-12-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_brand")
public class Brand implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 品牌id
     */
    @TableId(value = ID, type = IdType.AUTO)
    private Integer id;

    /**
     * 品牌名称
     */
    @TableField(NAME)
    private String name;

    /**
     * 品牌图片地址
     */
    @TableField(IMAGE)
    private String image;

    /**
     * 品牌的首字母
     */
    @TableField(LETTER)
    private String letter;

    /**
     * 排序
     */
    @TableField(SEQ)
    private Integer seq;


    public static final String ID = "`id`";

    public static final String NAME = "`name`";

    public static final String IMAGE = "`image`";

    public static final String LETTER = "`letter`";

    public static final String SEQ = "`seq`";


    public static final String ID_COMMENT = "品牌id";

    public static final String NAME_COMMENT = "品牌名称";

    public static final String IMAGE_COMMENT = "品牌图片地址";

    public static final String LETTER_COMMENT = "品牌的首字母";

    public static final String SEQ_COMMENT = "排序";



    public static Brand of(Object obj) {
        Brand e = new Brand();
        BeanUtils.copyProperties(obj, e);
        return e;
    }

    public static QueryWrapper<Brand> queryWrapper(Object obj) {
        return new QueryWrapper<>(of(obj));
    }

}
